import {BASE_URL, TIME_OUT} from "./config";
import CustomRequest from "./request";


export const request = new CustomRequest({
    baseURL: BASE_URL,
    timeout: TIME_OUT
})

export const request2 = new CustomRequest({
    baseURL: "http://codercba.com:1888/airbnb/api",
    timeout: 8000,
    interceptors: {
        requestInterceptors: (config) => {
            console.log("xx的请求成功的拦截")
            return config
        },
        requestInterceptorsCatch: (err) => {
            console.log("xx的请求失败的拦截")
            return err
        },
        responseInterceptors: (res) => {
            console.log("xx的响应成功的拦截")
            return res
        },
        responseInterceptorsCatch: (err) => {
            console.log("xx的响应失败的拦截")
            return err
        }
    }
})